<?php
    include('./config.php');
    include('./request.php');
    $market_name = $result->marketName;
    $market_type = $result->marketType;
    $market_author = $result->marketAuthor;
    $market_email = $result->marketEmail;
    $market_phone = $result->marketPhone;
    try{
        $pdo = new PDO($dsn,$user,$pass);
        $sql = "update market set market_name='".$market_name."',market_type='".$market_type."',market_author='".$market_author."',market_email='".$market_email."',market_phone='".$market_phone."' where market_name='".$market_name."'";
        $res = $pdo->prepare($sql);
        $res->execute();
        if($res){
            echo "ok";
        }else{
            echo "error";
        }
    }catch(PDOException $e){
        echo "error";
    }
?>